<?php 
    include "database.php";
    //Za delovanje seje na vseh nivojih
    session_set_cookie_params(0,"/");
    session_start();

    if(!isset($_SESSION['username'])) {
        header("Location: login.php");
    }
    
    $admin = checkAdmin($_SESSION['id']);
    
    $usr_id = $_SESSION['id'];
    $queryProject = "SELECT current_project FROM user WHERE id = '$usr_id'";
    $resProject = executeQuery($queryProject);
    $row = mysql_fetch_array($resProject);
    $curr_proj = $row["current_project"];
    
    $show = 1;
    $queryCheck = "SELECT * FROM story WHERE story_finished < 1 and project_id = '$curr_proj'";
    $queryCheckResult = executeQuery($queryCheck);
                                            
        if (mysql_num_rows($queryCheckResult) < 1){
            $show = 0;
        }
   
   $queryMaster = "SELECT scrum_master, product_owner FROM project WHERE project_id = '$curr_proj';";
   $resultMaster = executeQuery($queryMaster);
   $rowMaster = mysql_fetch_array($resultMaster);
   $projectMaster = $rowMaster["scrum_master"];
   $productOwner = $rowMaster["product_owner"];
   $notSet = "/";

?>

<!DOCTYPE html>

<html>
	<head>
	    <meta charset="utf-8">
		
		<!-- Font weight: light (300) & semibold (600) -->
		<link href='http://fonts.googleapis.com/css?family=Open+Sans:600,300' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" href="css/default.css"/>
		<link rel="stylesheet" href="css/tabs.css"/>
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
		
		<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.10.2.custom.min.js"></script>
		<script type="text/javascript" src="js/actions.js"></script>
		
		<title>Scrum | Sprint Backlog</title>		
	</head>
	
	<body>
	
		<span id="username"><?php echo $_SESSION['username']  ?></span>
		<span id="separator">|</span>
		<span id="role"><a href="editProfile.php">edit</a></span>
		
		<h1>Scrum</h1>
		
		<menu>
			<li><a href="control_panel.php">control<span>Panel</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="project_wall.php">project<span>Wall</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="product_backlog.php">product<span>Backlog</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a class="active" href="sprint_backlog.php">sprint<span>Backlog</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="my_tasks.php">my<span>Tasks</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="progress_report.php">progress<span>Reports</span></a>&nbsp;&nbsp;|&nbsp;</li>
			<li><a href="login.php">logout</a></li>
		</menu>
		
		<section>
		
			<ul id="tabs">
				<li><h2><a href="#" name="all_stories">all<span>Stories</span></a></h2></li>
                                <?php //if ($usr_id != $productOwner || ($usr_id == $productOwner && ($admin < 1 || $usr_id == $projectMaster)) || ($usr_id == $productOwner && ($admin == 1 || $usr_id == $projectMaster))){ 
                                if ($usr_id != $productOwner) {
                                ?>
				<li><h2><a href="#" name="my_stories">my<span>Stories</span></a></h2></li>
                                <?php } ?>
			</ul>
			
			
			<!--=========-->
			<!-- Dialogs -->
			<!--=========-->
				
			<div id="notes_dialog" title="Edit notes">
				<form class="dialog_form">
					<textarea name="notes" placeholder="notes..." id="notes"></textarea>
				</form>
			</div>
			
			<div id="tasks_dialog" title="Edit tasks">
				<table id="tasks_dialog_table" class="tasks_table">
					<thead>
						<td>tasks</td><td>delete</td><td>member</td><td>estimate</td>
					</thead>
					<tr>
						<td>Razrez</td><td colspan="3" align="center">Task is already assigned</td>
					</tr>
					<tr>
						<td><input class="task_name" type="text" value="Uredi podatkovno bazo"/></td><td><a class="delete_task">delete</a></td><td>
							<select class="task_member">
								<option value="" disabled selected>member</option>
								<option value="1">gkolenc</option>
								<option value="2">gurh</option>
								<option value="3">akunovar</option>
								<option value="4">dkalanj</option>
								<option value="5">gurh</option>
								<option value="6">akunovar</option>
								<option value="7">dkalanj</option>
							</select>
						</td><td><input class="task_estimate" type="text" name="time"/></td>
					</tr>
					<tr>
						<td><input class="task_name" type="text" value="Uredi podatkovno bazo"/></td><td><a class="delete_task">delete</a></td><td>
							<select class="task_member">
								<option value="" disabled selected>member</option>
								<option value="1">gkolenc</option>
								<option value="2">gurh</option>
								<option value="3">akunovar</option>
								<option value="4">dkalanj</option>
								<option value="5">gurh</option>
								<option value="6">akunovar</option>
								<option value="7">dkalanj</option>
							</select>
						</td><td><input class="task_estimate" type="text" name="time"/></td>
					</tr>
				</table>
				
				<input id="tasks_input_description" type="text" name="tasks_input_description" placeholder="new task description"/>
				<button id="tasks_submit_new" type="submit">create</button>
			</div>
			
			<div id="tab_content">
			
				<!--=============-->
				<!-- All stories -->
				<!--=============-->
			
				<div id="all_stories" class="stories_container">
                                    
                                            <?php                                 
                                            /*$querySprint = "SELECT current_sprint FROM project"; //WHERE project_id = ena_spremenljivka";
                                            $querySprintResult = executeQuery($querySprint);    
                                            
                                            if (mysql_num_rows($querySprintResult) != 0){
                                                $row = mysql_fetch_array($querySprintResult);
                                                $current_sprint = $row["current_sprint"];
                                            }
                                            
                                            if (isset($current_sprint) && $current_sprint > 0){  */                                             

                                                $query = "SELECT * FROM story WHERE story_sprint > 0 and project_id = '$curr_proj' and story_finished < 1"; 
                                                $queryResult = executeQuery($query);
                                                
                                                if (mysql_num_rows($queryResult) != 0){
                                                    //echo "<h3>User stories for Sprint $current_sprint</h3>";

                                                    while ($row = mysql_fetch_array($queryResult)) {
                                                        $story_id       = $row["story_id"];
                                                        $story_title    = $row["story_title"];
                                                        $story_text     = $row["story_text"];
                                                        $story_test     = nl2br($row["story_test"]);
                                                        $story_value    = $row["story_value"];    
                                                        $story_time     = $row["story_time"];
                                                        $story_priority = $row["story_priority"];
                                                        $story_notes    = $row["story_notes"];

                                                        $prior = "priority not set";
                                                        if ($story_priority == 1)
                                                            $prior = "must have";
                                                        else if ($story_priority == 2)
                                                            $prior = "should have";
                                                        else if ($story_priority == 3)
                                                            $prior = "could have";
                                                        else if ($story_priority == 4)
                                                            $prior = "won't have this time";

                                                        if (!isset($story_time))
                                                            $story_time = "Not set";
                                                        else
                                                            $story_time = strval($story_time)." pt";
                                                        
                                                        print "<div class=\"story\">
                                                            <input type=\"hidden\" name=\"story_id\" value=\"$story_id\" />
						
                                                            <div class=\"header\">
                                                                    <h5>$story_title</h5><br/>
                                                                    <span class=\"values all_stories\"><span class=\"priority\">$prior</span> | business value: $story_value | time estimate: $story_time</span>";
                                                                    if ($admin < 1 || $projectMaster == $usr_id)
                                                                        print "<a href=\"#\" class=\"notes_story\">notes</a> | <a href=\"#\" class=\"edit_tasks\">edit tasks</a>";
                                                                    else
                                                                        print "<a href=\"#\" class=\"notes_story\">notes</a>";
                                                            print "</div>";
                                                            
                                                            if ($story_text != "")
                                                                echo "<p>$story_text</p>";
                                                            if ($story_test != ""){
                                                                echo "--";
                                                                print "<p class=\"test_list\">$story_test</p>";
                                                            }
                                                            //<span class=\"comment_separator\">--</span>
                                                            //<p class=\"comments\">To so možni komentarji...</p>

                                                            print "<!-- Tasks -->
                                                            <table class=\"tasks_table\">";
                                                         
                                                                    $query_task = "SELECT * FROM task WHERE story_id = '$story_id'"; 
                                                                    $queryTaskResult = executeQuery($query_task);
                                                
                                                                    if (mysql_num_rows($queryTaskResult) != 0){
                                                                        print "<thead>
                                                                                   <td>tasks</td><td>status</td><td>member</td><td>remaining</td>
                                                                               </thead>";

                                                                        while ($row = mysql_fetch_array($queryTaskResult)) 
                                                                        {
                                                                            $task_id          = $row["task_id"];
                                                                            $task_title       = $row["task_title"];
                                                                            $task_status      = $row["task_status"];
                                                                            $task_time        = ($row['task_time']<0)?"$notSet":$row['task_time']." h";
                                                                            
                                                                            $assigned_id      = $row["assigned_id"];
                                                                            $developer        = "Not selected";
                                                                            $query_developer  = "SELECT username FROM user WHERE id = '$assigned_id'"; 
                                                                            $queryDeveloperResult = executeQuery($query_developer);
                                                                            if (mysql_num_rows($queryTaskResult) != 0)
                                                                                while ($rowDeveloper = mysql_fetch_array($queryDeveloperResult)) 
                                                                                    $developer = $rowDeveloper["username"];
                                                                            
                                                                            if ($task_status == 0){
                                                                                //if ($usr_id != $productOwner || ($usr_id == $productOwner && $admin < 2) )
                                                                                if ($usr_id != $productOwner)
                                                                                    print "<tr>
                                                                                               <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                               <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                               <td>$task_title</td><td><a class=\"accept_task\">Accept task</td></a><td>$developer</td><td>$task_time</td>
                                                                                         </tr>";
                                                                                else
                                                                                    print "<tr>
                                                                                               <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                               <td>$task_title</td><td>Not selected</td></a><td>$developer</td><td>$task_time</td>
                                                                                         </tr>";
                                                                            }
                                                                            else if ($task_status == 1){
                                                                                // if ($assigned_id == $usr_id){ ????
                                                                                if ($usr_id == $projectMaster || $assigned_id == $usr_id){
                                                                                    print "<tr>
                                                                                           <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                           <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                           <td>$task_title</td><td>Assigned</td><td>$developer (<a class=\"release_task\">release</a>)</td><td>$task_time</td>
                                                                                       </tr>";
                                                                                }else{
                                                                                    print "<tr>
                                                                                               <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                               <td>$task_title</td><td>Assigned</td><td>$developer</td><td>$task_time</td>
                                                                                           </tr>";
                                                                                }
                                                                            }
                                                                            else if ($task_status == 2){
                                                                                if ($assigned_id == $usr_id || $usr_id == $projectMaster){
                                                                                    print   "<tr>
                                                                                                <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                                <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                <td>$task_title</td><td>Completed</td><td>$developer (<a class=\"release_task\">release</a>)</td><td>$task_time</td>
                                                                                            </tr>";
                                                                                }else{
                                                                                    print   "<tr>
                                                                                                <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                <td>$task_title</td><td>Completed</td><td>$developer </td><td>$task_time</td>
                                                                                           </tr>";
                                                                                }
                                                                            }
                                                                        }
                                                                    }else{
                                                                        print "<thead>
                                                                                    <td>Story has no tasks</td>
                                                                               </thead>";
                                                                    }
                                                                    
                                                                    if ($story_notes != "")
                                                                        print "--
                                                                        <p>$story_notes</p>
                                                                        <!--<p>To so možni komentarji...</p>-->";   
                                                                    
                                                                    /*print "<tr>
                                                                            <td>Razrez</td><td>Completed</td><td>gkolenc (<a class=\"release_task\">release</a>)</td><td>2 h</td>
                                                                    </tr>
                                                                    <tr>
                                                                            <td>Uredi bazo</td><td>Assigned</td><td>akunovar</td><td>2 h</td>
                                                                    </tr>
                                                                    <tr>
                                                                            <td>Testiranje</td><td><a class=\"accept_task\">Accept task</a></td><td>Not selected</td><td>5 h</td>
                                                                    </tr>";*/
                                                                    


                                                            print "</table>";
                                                            
                                                            /*if ($usr_id == $productOwner)
                                                                print  "<!-- Visible only to product owner -->
                                                                        <div class=\"story_confirming\">
                                                                                <button type=\"button\" class=\"confirm_story_submit\">confirm</button>
                                                                                <button type=\"button\" class=\"reject_story_submit\">reject</button>
                                                                        </div>";*/
                                                    print "</div>";
                                                                                          
                                                     }
                                                }
                                             //}
                                            ?>
                                    
                                    
                                    
					<!--<div class="story">
						<input type="hidden" name="story_id" value="1" />
						
						<div class="header">
							<h5>Dodajanje uporabnikov</h5><br/>
							<span class="values all_stories"><span class="priority">could have</span> | business value: 0 | time estimate: 2.5 pt</span>
							<a href="#" class="notes_story">notes</a> | <a href="#" class="edit_tasks">edit tasks</a>
						</div>
						
						<p>Administrator sistema lahko vnaša nove uporabnike v sistem. Določi jim uporabniško ime in geslo, osebne podatke (ime, priimek, e-pošta) in sistemske pravice (administrator sistema, uporabnik sistema).</p>
						--
						<p class="test_list"># Preveri dodajanje novega uporabnika skupaj s pripadajočimi podatki.<br/># Preveri dodajanje uporabnika z obstoječim uporabniškim imenom.<br/># Preveri, ali sistem upošteva dodeljene sistemske pravice.</p>
						<span class="comment_separator">--</span>
						<p class="comments">To so možni komentarji...</p>-->
						
						<!-- Tasks -->
						<!--<table class="tasks_table">
							<thead>
								<td>tasks</td><td>status</td><td>member</td><td>remaining</td>
							</thead>
							<tr>
								<td>Razrez</td><td>Completed</td><td>gkolenc (<a class="release_task">release</a>)</td><td>2 h</td>
							</tr>
							<tr>
								<td>Uredi bazo</td><td>Assigned</td><td>akunovar</td><td>2 h</td>
							</tr>
							<tr>
								<td>Testiranje</td><td><a class="accept_task">Accept task</a></td><td>Not selected</td><td>5 h</td>
							</tr>
						</table>-->
						
						<!-- Visible only to product owner -->
						<!--<div class="story_confirming">
							<button type="button" class="confirm_story_submit">confirm</button>
							<button type="button" class="reject_story_submit">reject</button>
						</div>
					</div>
					
					<div class="story">
						<input type="hidden" name="story_id" value="2" />
						
						<div class="header">
							<h5>Brisanje uporabnikov</h5><br/>
							<span class="values all_stories"><span class="priority">could have</span> | business value: 0 | time estimate: 2.5 pt</span>
							<a href="#" class="notes_story">notes</a> | <a href="#" class="edit_tasks">edit tasks</a>
						</div>
						
						<p>Administrator sistema lahko vnaša nove uporabnike v sistem. Določi jim uporabniško ime in geslo, osebne podatke (ime, priimek, e-pošta) in sistemske pravice (administrator sistema, uporabnik sistema).</p>
						--
						<p class="test_list"># Preveri dodajanje novega uporabnika skupaj s pripadajočimi podatki.<br/># Preveri dodajanje uporabnika z obstoječim uporabniškim imenom.<br/># Preveri, ali sistem upošteva dodeljene sistemske pravice.</p>
						<span class="comment_separator">--</span>
						<p class="comments">To so možni komentarji...</p>-->
						
						<!-- Tasks -->
						<!--<table class="tasks_table">
							<thead>
								<td>tasks</td><td>status</td><td>member</td><td>remaining</td>
							</thead>
							<tr>
								<td>Zacetek</td><td>Completed</td><td>gkolenc</td><td>2 h</td>
							</tr>
							<tr>
								<td>Uredi neki</td><td>Assigned</td><td>akunovar</td><td>2 h</td>
							</tr>
							<tr>
								<td>Testiranje</td><td><a class="accept_task">Accept task</a></td><td>Not selected</td><td>5 h</td>
							</tr>
						</table>-->
						
						<!-- Visible only to product owner -->
						<!--<div class="story_confirming">
							<button type="button" class="confirm_story_submit">confirm</button>
							<button type="button" class="reject_story_submit">reject</button>
						</div>
					</div>-->
				</div>
				
				<!--============-->
				<!-- My stories -->
				<!--============-->
				<?php
                                    if ($admin < 2){
                                        
                                ?>
				<div id="my_stories" class="stories_container">
					
                                            
                                            <?php                                 
                                            /*$querySprint = "SELECT current_sprint FROM project"; //WHERE project_id = ena_spremenljivka";
                                            $querySprintResult = executeQuery($querySprint);    
                                            
                                            if (mysql_num_rows($querySprintResult) != 0){
                                                $row = mysql_fetch_array($querySprintResult);
                                                $current_sprint = $row["current_sprint"];
                                            }
                                            
                                            if (isset($current_sprint) && $current_sprint > 0){  */                                         

                                                $query = "SELECT * FROM story WHERE story_sprint > 0 and project_id = '$curr_proj' and story_finished < 1"; 
                                                $queryResult = executeQuery($query);
                                                
                                                if (mysql_num_rows($queryResult) != 0){
                                                    //echo "<h3>User stories for Sprint $current_sprint</h3>";

                                                    while ($row = mysql_fetch_array($queryResult)) {                                                                     
                                                        
                                                        $story_id       = $row["story_id"];
                                                        $story_title    = $row["story_title"];
                                                        $story_text     = $row["story_text"];
                                                        $story_test     = nl2br($row["story_test"]);
                                                        $story_value    = $row["story_value"];    
                                                        $story_time     = $row["story_time"];
                                                        $story_priority = $row["story_priority"];
                                                        $my_task_bool   = 0;
                                                        
                                                        $queryMyTasks = "SELECT assigned_id FROM task WHERE story_id = '$story_id'";
                                                        $queryMyTasksResult = executeQuery($queryMyTasks); 

                                                        if (mysql_num_rows($queryMyTasksResult) != 0){
                                                            while ($rowMyTasks = mysql_fetch_array($queryMyTasksResult)) { 
                                                                $myTask = $rowMyTasks["assigned_id"];
                                                                if ($myTask == $usr_id)
                                                                    $my_task_bool = 1;
                                                            }
                                                        }
                                                        
                                                        if ($my_task_bool > 0){
                                                        
                                                            $prior = "priority not set";
                                                            if ($story_priority == 1)
                                                                $prior = "must have";
                                                            else if ($story_priority == 2)
                                                                $prior = "should have";
                                                            else if ($story_priority == 3)
                                                                $prior = "could have";
                                                            else if ($story_priority == 4)
                                                                $prior = "won't have this time";

                                                            if (!isset($story_time))
                                                                $story_time = "Not set";
                                                            else
                                                                $story_time = strval($story_time)." pt";

                                                            print "<div class=\"story\">
                                                                <input type=\"hidden\" name=\"story_id\" value=\" $story_id \" />

                                                                <div class=\"header\">
                                                                        <h5>$story_title</h5><br/>
                                                                        <span class=\"values all_stories\"><span class=\"priority\">$prior</span> | business value: $story_value | time estimate: $story_time</span>
                                                                        <a href=\"#\" class=\"notes_story\">notes</a> | <a href=\"#\" class=\"edit_tasks\">edit tasks</a>
                                                                </div>

                                                                <p>$story_text</p>";
                                                                if ($story_test != "")
                                                                    echo "--";

                                                                print "<p class=\"test_list\">$story_test</p>";
                                                                //<span class=\"comment_separator\">--</span>
                                                                //<p class=\"comments\">To so možni komentarji...</p>

                                                                print "<!-- Tasks -->
                                                                <table class=\"tasks_table\">";


                                                                        $query_task = "SELECT * FROM task WHERE story_id = '$story_id'"; 
                                                                        $queryTaskResult = executeQuery($query_task);

                                                                        if (mysql_num_rows($queryTaskResult) != 0){
                                                                            print "<thead>
                                                                                       <td>tasks</td><td>status</td><td>member</td><td>remaining</td>
                                                                                   </thead>";

                                                                            while ($row = mysql_fetch_array($queryTaskResult)) 
                                                                            {
                                                                                $task_id          = $row["task_id"];
                                                                                $task_title       = $row["task_title"];
                                                                                $task_status      = $row["task_status"];
                                                                                $task_time        = $row["task_time"];

                                                                                $assigned_id      = $row["assigned_id"];
                                                                                $developer = "Not selected";
                                                                                $query_developer = "SELECT username FROM user WHERE id = '$assigned_id'"; 
                                                                                $queryDeveloperResult = executeQuery($query_developer);
                                                                                if (mysql_num_rows($queryTaskResult) != 0)
                                                                                    while ($row = mysql_fetch_array($queryDeveloperResult)) 
                                                                                        $developer = $row["username"];

                                                                                if ($task_status == 0){
                                                                                    //if ($usr_id != $productOwner || ($usr_id == $productOwner && $admin < 2))
                                                                                    if ($usr_id != $productOwner)
                                                                                        print "<tr >
                                                                                                   <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                                   <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                   <td>$task_title</td><td><a class=\"accept_task\">Accept task</td></a><td>$developer</td><td>$task_time h</td>
                                                                                             </tr>";
                                                                                    else
                                                                                        print "<tr>
                                                                                                   <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                   <td>$task_title</td><td></td></a><td>$developer</td><td>$task_time h</td>
                                                                                             </tr>";
                                                                                }
                                                                                else if ($task_status == 1){
                                                                                    if ($assigned_id == $usr_id || $usr_id == $projectMaster){
                                                                                        print "<tr>
                                                                                                    <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                                    <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                    <td>$task_title</td><td>Assigned</td><td>$developer (<a class=\"release_task\">release</a>)</td><td>$task_time h</td>
                                                                                               </tr>";
                                                                                    }else{
                                                                                        print "<tr>
                                                                                                   <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                   <td>$task_title</td><td>Assigned</td><td>$developer</td><td>$task_time h</td>
                                                                                               </tr>";
                                                                                    }
                                                                                }
                                                                                else if ($task_status == 2){
                                                                                    if ($assigned_id == $usr_id || $usr_id == $projectMaster){
                                                                                        print "<tr>
                                                                                                  <input type=\"hidden\" name=\"developer\" value=\"$usr_id\" />
                                                                                                  <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                  <td>$task_title</td><td>Completed</td><td>$developer (<a class=\"release_task\">release</a>)</td><td>$task_time h</td>
                                                                                               </tr>";
                                                                                    }else{
                                                                                        print "<tr>
                                                                                                  <input type=\"hidden\" name=\"task_id\" value=\" $task_id \" />
                                                                                                  <td>$task_title</td><td>Completed</td><td>$developer </td><td>$task_time h</td>
                                                                                               </tr>";
                                                                                    }
                                                                                }
                                                                            }
                                                                        }else{
                                                                            print "<thead>
                                                                                        <td>Story has no tasks</td>
                                                                                   </thead>";
                                                                        }

                                                                        /*print "<tr>
                                                                                <td>Razrez</td><td>Completed</td><td>gkolenc (<a class=\"release_task\">release</a>)</td><td>2 h</td>
                                                                        </tr>
                                                                        <tr>
                                                                                <td>Uredi bazo</td><td>Assigned</td><td>akunovar</td><td>2 h</td>
                                                                        </tr>
                                                                        <tr>
                                                                                <td>Testiranje</td><td><a class=\"accept_task\">Accept task</a></td><td>Not selected</td><td>5 h</td>
                                                                        </tr>";*/



                                                                print "</table>";
                                                                /*
                                                                if ($admin == 2)
                                                                    print  "<!-- Visible only to product owner -->
                                                                            <div class=\"story_confirming\">
                                                                                    <button type=\"button\" class=\"confirm_story_submit\">confirm</button>
                                                                                    <button type=\"button\" class=\"reject_story_submit\">reject</button>
                                                                            </div>";*/
                                                            print "</div>";
                                                        }  
                                                        $my_task_bool = 0;
                                                     }
                                                }
                                             //}
                                            ?>
                                            <!--<div class="story">
						<input type="hidden" name="story_id" value="1" />
						
						<div class="header">
							<h5>Dodajanje uporabnikov</h5><br/>
							<span class="values all_stories"><span class="priority">could have</span> | business value: 0 | time estimate: 2.5 pt</span>
							<a href="#" class="notes_story">notes</a> | <a href="#" class="edit_tasks">edit tasks</a>
						</div>
						
						<p>Administrator sistema lahko vnaša nove uporabnike v sistem. Določi jim uporabniško ime in geslo, osebne podatke (ime, priimek, e-pošta) in sistemske pravice (administrator sistema, uporabnik sistema).</p>
						--
						<p class="test_list"># Preveri dodajanje novega uporabnika skupaj s pripadajočimi podatki.<br/># Preveri dodajanje uporabnika z obstoječim uporabniškim imenom.<br/># Preveri, ali sistem upošteva dodeljene sistemske pravice.</p>
						<span class="comment_separator">--</span>
						<p class="comments">To so možni komentarji...</p>-->
						
						<!-- Tasks -->
						<!--<table class="tasks_table">
							<thead>
								<td>tasks</td><td>status</td><td>member</td><td>remaining</td>
							</thead>
							<tr>
								<td>Razrez</td><td>Completed</td><td>gkolenc</td><td>2 h</td>
							</tr>
							<tr>
								<td>Uredi bazo</td><td>Assigned</td><td>akunovar</td><td>2 h</td>
							</tr>
							<tr>
								<td>Testiranje</td><td><a class="accept_task">Accept task</a></td><td>Not selected</td><td>5 h</td>
							</tr>
						</table>
					</div>-->
				</div>
                                <?php
                                    }
                                ?>
			</div>
		
		</section>
		
	</body>
</html>